package JJJJJJava.ParquetPartitionDiscovery;

import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.sql.DataFrame;
import org.apache.spark.sql.SQLContext;

/**
 *  Parquet数据源之自动推断分区
 * @Auther: Mengkunxuan
 * @Date:2018/9/2716:19
 * @Description:
 */
public class ParquetPartitionDiscovery {
    public static void main(String[] args) {
        SparkConf conf = new SparkConf().setMaster("local").setAppName("ParquetPartitionDiscovery");
        JavaSparkContext sc = new JavaSparkContext(conf);
        SQLContext sqlContext = new SQLContext(sc);
        DataFrame usersDF = sqlContext.read().parquet("C:\\Users\\Administrator\\Desktop\\第一阶段代码\\第76讲-Spark SQL：数据源之通用的load和save操作\\文档\\users.parquet");
        usersDF.printSchema();
        usersDF.show();
    }
}
